<div class="row">
<div class="button-container mb10">
<?php 
    echo Yii::app()->user->checkAccess('model|addField')?CHtml::link('添加字段',$this->createUrl('model/addField' ,array('model_id'=>$params['model_id'])) ,array('class'=>'button')):'';
    echo CHtml::link('返回模型管理',$this->createUrl('model/index') ,array('class'=>'button ml20'));
    echo Yii::app()->user->checkAccess('model|priview') ?
         CHtml::link('预览' ,$this->createUrl('model/priview' ,array('model_id'=>$params['model_id'])) ,array('class'=>'button ml20' ,'target'=>'_blank')) ."\n" : '';
?>
</div>
<!--表格数据-->
<table class="table table-bordered table-striped dataGrid">
        <thead>
            <tr>
                <th style="width: 80px;"><input type="checkbox" class="btn_all" /><?php echo $this->_attributeFieldLabels['sort'] ?></th>
                <th><?php echo $this->_attributeFieldLabels['field'] ?></th>
                <th><?php echo $this->_attributeFieldLabels['field_name'] ?></th>
                <th><?php echo $this->_attributeFieldLabels['form_type'] ?></th>
                <th style="width: 40px;"><?php echo $this->_attributeFieldLabels['issystem'] ?></th>
                <th style="width: 40px;"><?php echo $this->_attributeFieldLabels['isnull'] ?></th>
				<th style="width: 40px;"><?php echo $this->_attributeFieldLabels['disable'] ?></th>
				<th style="width: 70px;">操作</th>
            </tr>
        </thead>
        <tbody>
        <?php if( !empty($list) ){foreach( $list as $aVal ){ ?>
            <tr>
                <td><input type="text" value="<?php echo $aVal['sort']; ?>" class="width20 ajaxOperateSort" url="<?php echo $this->createUrl('model/ajaxFieldSort' ,array('field_id'=>$aVal['field_id'])) ?>" /></td>
                <td><?php echo $aVal['field'] ?></td>
                <td><?php echo $aVal['field_name'] ?></td>
                <td><?php echo $aVal['form_type'] ?></td>
                <td><?php echo $aVal['issystem']==1 ? '是' :'<span class="red">否</span>'; ?></td>
                <td><?php echo $aVal['isnull']==1 ? '是' :'<span class="red">否</span>'; ?></td>
                <td>
                <?php
                    $sTextRed = $aVal['disable']==1 ? '' : 'red';
                    echo $aVal['issystem']==2 && Yii::app()->user->checkAccess('model|ajaxFieldDisable') ? 
                         CHtml::link($aVal['disable']==1 ? '禁用' : '启用' ,'javascript:void(0)' ,array('url'=>$this->createUrl('model/ajaxFieldDisable' ,array('field_id'=>$aVal['field_id'])) ,'class'=>"ajaxOperateReplace $sTextRed")) : '禁用';
                ?>
                </td>
                <td>
                <?php
                    echo CHtml::link('编辑' ,$this->createUrl('model/editField' ,array('model_id'=>$aVal['model_id'] ,'field_id'=>$aVal['field_id']))) ."\n";
                    echo $aVal['issystem']==2 && Yii::app()->user->checkAccess('model|deleteField') ? 
                         CHtml::link('删除','javascript:void(0);',array('url'=>$this->createUrl('model/deleteField' ,array('model_id'=>$aVal['model_id'],'field_id'=>$aVal['field_id'])) ,'class'=>'delete')) : '删除';
                ?>
                </td>
            </tr>
        <?php }} ?>               
        </tbody>
</table>
<!-- 分页page start -->
<div class="table-bottom-operate">
    <div class="inline pull-left table-operate">
    </div>
    <div class="inline pull-right page">
        <?php //$this->widget('LinkPager',array('pages' => $pages)); ?>
    </div>
	
</div>
<!-- 分页page end -->
</div>
